package com.ds.dsm.view.config.nav.items;

import com.ds.esd.custom.enums.AppendType;
import com.ds.esd.custom.field.ModuleFieldBean;
import com.ds.esd.dsm.view.field.FieldFormConfig;
import com.ds.esd.tool.ui.enums.ComponentType;
import com.ds.esd.tool.ui.enums.Dock;

public class ModuleItemsBean {

    String viewInstId;

    String domainId;

    String fieldname;

    String methodName;

    String caption;

    ComponentType componentType;

    Boolean hidden;

    AppendType append;

    String src;

    String expression;

    String entityClassName;

    String sourceClassName;


    Dock dock;

    String imageClass;

    String height;

    String width;

    Integer colSpan;

    Integer rowSpan;

    public ModuleItemsBean() {

    }

    public ModuleItemsBean(FieldFormConfig<ModuleFieldBean> config) {
        ModuleFieldBean fieldBean = config.getWidgetConfig();

        this.entityClassName = config.getEntityClassName();
        this.sourceClassName = config.getSourceClassName();
        this.viewInstId = config.getViewInstId();
        this.domainId = config.getDomainId();
        this.append = fieldBean.getAppend();
        this.src = fieldBean.getSrc();

        this.componentType = config.getAggConfig().getComponentType();

        this.caption = config.getAggConfig().getCaption();
        this.fieldname = config.getFieldname();
        this.hidden = config.getHidden();
        this.expression = config.getAggConfig().getExpression();

        this.hidden = config.getHidden();

        this.methodName = config.getMethodName();
        this.colSpan = config.getColSpan();
        this.dock = config.getDock();
        this.height = config.getHeight();
        this.width = config.getWidth();
        this.imageClass = config.getAggConfig().getImageClass();
        if (imageClass == null || imageClass.equals("")) {
            if (config.getAggConfig().getComponentType() != null) {
                imageClass = config.getAggConfig().getComponentType().getImageClass();
            }
        }

        this.rowSpan = config.getRowSpan();
        this.fieldname = config.getFieldname();


    }

    public String getDomainId() {
        return domainId;
    }

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    public AppendType getAppend() {
        return append;
    }

    public void setAppend(AppendType append) {
        this.append = append;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    public Dock getDock() {
        return dock;
    }

    public void setDock(Dock dock) {
        this.dock = dock;
    }

    public String getImageClass() {
        return imageClass;
    }

    public void setImageClass(String imageClass) {
        this.imageClass = imageClass;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public Integer getColSpan() {
        return colSpan;
    }

    public void setColSpan(Integer colSpan) {
        this.colSpan = colSpan;
    }

    public Integer getRowSpan() {
        return rowSpan;
    }

    public void setRowSpan(Integer rowSpan) {
        this.rowSpan = rowSpan;
    }

    public String getEntityClassName() {
        return entityClassName;
    }

    public void setEntityClassName(String entityClassName) {
        this.entityClassName = entityClassName;
    }

    public String getSourceClassName() {
        return sourceClassName;
    }

    public void setSourceClassName(String sourceClassName) {
        this.sourceClassName = sourceClassName;
    }

    public String getViewInstId() {
        return viewInstId;
    }

    public void setViewInstId(String viewInstId) {
        this.viewInstId = viewInstId;
    }

    public String getFieldname() {
        return fieldname;
    }

    public void setFieldname(String fieldname) {
        this.fieldname = fieldname;
    }


    public ComponentType getComponentType() {
        return componentType;
    }

    public void setComponentType(ComponentType componentType) {
        this.componentType = componentType;
    }

    public String getCaption() {
        return caption;
    }

    public void setCaption(String caption) {
        this.caption = caption;
    }


    public Boolean getHidden() {
        return hidden;
    }

    public void setHidden(Boolean hidden) {
        this.hidden = hidden;
    }

    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }
}
